package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.EmployeeSalaryMapper;
import cn.classyex.business.hr.domain.EmployeeSalary;
import cn.classyex.business.hr.service.IEmployeeSalaryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 员工薪资管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class EmployeeSalaryServiceImpl implements IEmployeeSalaryService 
{
    @Autowired
    private EmployeeSalaryMapper employeeSalaryMapper;

    /**
     * 查询员工薪资管理
     * 
     * @param employeeSalaryId 员工薪资管理ID
     * @return 员工薪资管理
     */
    @Override
    public EmployeeSalary selectEmployeeSalaryById(Long employeeSalaryId)
    {
        return employeeSalaryMapper.selectEmployeeSalaryById(employeeSalaryId);
    }

    /**
     * 查询员工薪资管理列表
     * 
     * @param employeeSalary 员工薪资管理
     * @return 员工薪资管理
     */
    @Override
    public List<EmployeeSalary> selectEmployeeSalaryList(EmployeeSalary employeeSalary)
    {
        return employeeSalaryMapper.selectEmployeeSalaryList(employeeSalary);
    }

    /**
     * 新增员工薪资管理
     * 
     * @param employeeSalary 员工薪资管理
     * @return 结果
     */
    @Override
    public int insertEmployeeSalary(EmployeeSalary employeeSalary)
    {
        employeeSalary.setCreateTime(DateUtils.getNowDate());
        return employeeSalaryMapper.insertEmployeeSalary(employeeSalary);
    }

    /**
     * 修改员工薪资管理
     * 
     * @param employeeSalary 员工薪资管理
     * @return 结果
     */
    @Override
    public int updateEmployeeSalary(EmployeeSalary employeeSalary)
    {
        employeeSalary.setUpdateTime(DateUtils.getNowDate());
        return employeeSalaryMapper.updateEmployeeSalary(employeeSalary);
    }

    /**
     * 删除员工薪资管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEmployeeSalaryByIds(String ids)
    {
        return employeeSalaryMapper.deleteEmployeeSalaryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除员工薪资管理信息
     * 
     * @param employeeSalaryId 员工薪资管理ID
     * @return 结果
     */
    @Override
    public int deleteEmployeeSalaryById(Long employeeSalaryId)
    {
        return employeeSalaryMapper.deleteEmployeeSalaryById(employeeSalaryId);
    }
}
